package com.pan.api.format.impl.markdown;

import com.pan.api.config.TitleConfig;
import com.pan.api.format.PanTotalFormat;

public class MarkdownPanTotalFormat implements PanTotalFormat, TitleConfig {

    private boolean firstFlag;

    public MarkdownPanTotalFormat() {
        this.firstFlag = true;
    }

    @Override
    public String append(String pre, String cur) {
        if (firstFlag){
            firstFlag = ! firstFlag;
            String title = getTitle();
            pre = """ 
                  # PanApiDoc
                    by   
                  <br>
                  """ + pre;
        }
        return PanTotalFormat.super.append(pre, cur);
    }

}
